import { Prisma, PrismaClient } from "@prisma/client";

const data: Prisma.FileDirectoryCreateManyInput[] = [
    {
        pid: 0,
        name: "系统图片",
        type: "image",
        sort: 1000,
        remark: "系统相关图片，如 logo,favicon,登录页背景图，联系方式图，默认的头像图等",
        isFixed: true
    },
    {
        pid: 0,
        name: "前台用户头像",
        type: "image",
        sort: 998,
        remark: "前台用户头像文件",
        isFixed: true
    },
    {
        pid: 0,
        name: "后台用户头像",
        type: "image",
        sort: 998,
        remark: "后台用户头像文件",
        isFixed: true
    },
    {
        pid: 0,
        name: "营销图片",
        type: "image",
        sort: 997,
        remark: "应用营销相关图片，如活动图片，宣传资料，banner，首页介绍服务的大图标等",
        isFixed: true
    },
    {
        pid: 0,
        name: "营销视频",
        type: "video",
        sort: 997,
        remark: "应用营销相关视频，如活动视频，宣传视频，视频教程等",
        isFixed: true
    },
    {
        pid: 0,
        name: "文章图片",
        type: "image",
        sort: 996,
        remark: "文章相关图片，如文章图片，文章附件等",
        isFixed: true
    },
    {
        pid: 0,
        name: "文章附件",
        type: "other",
        sort: 996,
        remark: "文章相关附件，如文章附件，附件文件等",
        isFixed: true
    }
];

export const seedFileDirectory = async (prisma: PrismaClient) => {
    await prisma.fileDirectory.deleteMany();
    await prisma.fileDirectory.createMany({ data });
};
